package com.tuzhi.base.jpa.repository;

import java.util.List;
import java.util.Map;

public interface CommonSqlRepo {

    public <T> List<T> findAllByJpqlMap(String jpql, Class<T> c, Map<String, Object> params);

    public <T> List<T> findAllByJpql(String jpql, Class<T> c, Object... params);

    public int executeJpqlMap(String jpql, Map<String, Object> params);

    public int executeJpql(String jpql, Object... params);

    public <T> List<T> findAllBySqlMap(String sql, Class<T> c, Map<String, Object> params);

    public <T> List<T> findAllBySql(String sql, Class<T> c, Object... params);

    public List findOneColBySql(String sql, Object... params);

    public List findOneColBySqlMap(String sql, Map<String, Object> params);

    public Object findSingleResultBySql(String sql, Object... params);

    public Object findSingleResultBySqlMap(String sql, Map<String, Object> params);

    public int executeSqlMap(String jpql, Map<String, Object> params);

    public int executeSql(String jpql, Object... params);

    public <T> List<T> findAllMapBySqlMap(String sql, Map<String, Object> params);

    public <T> List<T> findAllMapBySql(String sql, Object... params);

    @Deprecated
    <T> List<T> saveAll(List<T> list, Integer batchSize);

    @Deprecated
    <T> List<T> updateAll(List<T> list, Integer batchSize);

    <T> List<T> batchSaveAll(List<T> list, Integer batchSize);
}
